package cn.javase.concurrent._设计模式._同步模式之Balking;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        MonitorService monitorService = new MonitorService();
        for (int i = 0; i < 100; i++) {
            new Thread(monitorService::start).start();
        }
        Thread.sleep(2000);
        monitorService.stop();
    }
}
